#include<bits/stdc++.h>
#define sd(n) scanf("%d",&n) 
#define sld(n) scanf("%lld",&n)
#define pd(n) printf("%d", (n))
#define pld(n) printf("%lld", n)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define fi first
#define se second
const int N = 2e5;
const int maxn = 1e6;
typedef long long int ll;
using namespace std;
//----------------------------------------------------------------------------//
int arr[N];//原
int sum[N];//前缀和
void solve()
{
	int n, q;
	sd(n); sd(q);

	for (int i = 0; i < n; i++)
		sd(arr[i]);
	sort(arr, arr + n, greater<int>());

	//前缀和
	for (int i = 0; i <= n; i++)
	{
		sum[i] = sum[i - 1] + arr[i];
	}
	
	while (q--)
	{
		int eng;
		sd(eng);
		int find = lower_bound(sum, sum + n, eng)-sum+1;//由于返回的是那个元素的地址，运用指针相减得区间的性质,+1应为下标从0开始
		if (find == n + 1)//找不到返回迭代器的end()
		{
			cout << -1 << '\n';
		}
		else cout << find << '\n';
	}

}

int main()
{
	int T;
	sd(T);
	while (T--)
	{
		solve();
	}

	/*int b[] = { 1,2,30,40,50,60 };
	cout<<lower_bound(b, b+6, 30)-b;*/
	return 0;
}